import axios from "axios";
import { BASE_ANIME_URL,TIMEOUT } from "./config";
import AxiosUtils from './AxiosUtils'

/**
 * 创建公共实例
 */
const instance = axios.create({
    baseURL:BASE_ANIME_URL,
    timeout: TIMEOUT,
})
new AxiosUtils(instance)


/**
 * get请求
 * @param {*请求地址} url 
 * @returns 
 */
export function getax(url) {
    return instance.get(url)
}

/**
 * post请求
 * @param {*请求地址} url 
 * @param {*请求参数} param 
 * @param {*请求配置} config 
 * @returns 
 */
export function postax(url, param,config) {
    return instance.post(url,param,config)
}

export function deleteax(url, param){
    return instance.delete(url,param)
}
